package main

import "fmt"

func swap(p1 *int, p2 *int) {
	*p1, *p2 = *p2, *p1
	fmt.Printf("inner a=%v,b=%v\n", *p1, *p2)
}

//指针变量接收内存地址，交换值
func main() {
	a := 10
	b := 20
	fmt.Printf("outer a=%v,b=%v\n", a, b)
	swap(&a, &b)
}
